<script setup lang="tsx">
type ModalType = 'add' | 'view' | 'edit'
const props = defineProps<{
  visible: boolean
  modalName: string
}>()
const modalType = shallowRef<ModalType>('add')
const modalTitle = computed(() => {
  const titleMap: Record<ModalType, string> = {
    add: '创建',
    view: '查看',
    edit: '编辑',
  }
  return `${titleMap[modalType.value]}${props.modalName}`
})
</script>

<template>
  <n-modal
    :show="props.visible"
    :mask-closable="false"
    preset="card"
    :title="modalTitle"
    class="w-700px"
    :segmented="{
      content: true,
      action: true,
    }"
  >
    创建用户
  </n-modal>
</template>

<style scoped>

</style>
